home *** CD-ROM | disk | FTP | other *** search
- /************************************************************************************/
- /* CursorSelect */
- /* */
- /* Controls the choice of cursor. Executed from main event loop with theWindow, */
- /* and partNo, or from anywhere else with just the cursorNo. If all three are */
- /* NIL, initialize the cursor to the startup arrow. */
- /* */
- /************************************************************************************/
-
- #include "MyHeaders.h"
-
- short CursorSelect(WindowPtr theWindow, short partNo, short cursorNo)
- {
- short CSRetCode = 0; /* set return code */
- Cursor **theCursor; /* handle to cursor */
- TEHandle myTEdHandle; /* work handle */
-
- if (theWindow == FrontWindow()) /* if in front window */
- {
- WorkRetCode = WhichWindow(theWindow, &windSub); /* find which window */
- switch (windTbl[windSub].windRec.refCon) /* switch by wind type */
- {
- case (ProcMain): /* if main window */
- InitCursor(); /* set arrow cursor */
- break;
-
-
- case (ProcText): /* if text window */
- switch (partNo) /* where in window? */
- {
- case (inContent): /* if in content region */
- if (PtInRect(locMouse, /* TE view? */
- &(**windTbl[windSub].windTEH[0]).viewRect))
- { /* get I-beam */
- theCursor = GetCursor(iBeamCursor);
- SetCursor ((CursPtr) *theCursor); /* set it */
- }
- else /* elsewhere in content */
- InitCursor(); /* set arrow */
- break;
-
- default: /* not in content */
- InitCursor(); /* set arrow */
- break;
- }
- break; /* end of text window */
-
-
- case (ProcHelp): /* if Help window */
- InitCursor(); /* set arrow cursor */
- break;
- }
- }
-
- else /* else if not in a wdo */
- if (partNo) /* if known part number */
- InitCursor(); /* set arrow */
-
- else
- if (cursorNo) /* else if specific csr */
- {
- theCursor = GetCursor(cursorNo); /* get specific cursor */
- SetCursor ((CursPtr) *theCursor); /* set it */
- }
- else /* if not front window */
- InitCursor(); /* or all NIL set arrow */
-
- return CSRetCode; /* return */
- }